package cn.dansj.common.utils.exception;

import java.lang.reflect.Type;

public class DeserializationException extends RuntimeException {
    private static final String MSG_FOR_SPECIFIED_CLASS = "deserialize for class [%s] failed. ";
    private static final String DEFAULT_MSG = "deserialize failed. ";

    public DeserializationException(Throwable throwable) {
        super(DEFAULT_MSG, throwable);
    }

    public DeserializationException(Type type, Throwable throwable) {
        super(String.format(MSG_FOR_SPECIFIED_CLASS, type.getTypeName()), throwable);
    }
}
